<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>聊天记录</title>
	<style type="text/css">
		#div1{
			height:240px;
			width:280px;
			border:1px solid #ccc;
		}
	</style>
	<script type="text/javascript">
	window.onload = function(){
		var oDiv = document.getElementById('div1');
		var oSpan = document.getElementById('span1');
		var oText = document.getElementById('text1');
		var oBtn = document.getElementById('button1');
		oBtn.onclick = function(){
			oDiv.innerHTML += oSpan.innerHTML + oText.value + '<br/>';
			oText.value = '';
		}
	}
	</script>
</head>
<body>
	<div id="div1"></div>
	<span id="span1">妙味：</span>
	<input id="text1" type="text" />
	<input id="button1" type="button" value="发送" />
</body>
</html>